<template>
	<view class='page'>
		<view class='mes' v-for='n in goods' :key='n'>
		  <image src="../../static/images/icon-mes.png" class="icon"></image>
		  <view>
		    <view class='mes-title'>{{n.message_info}}</view>
		  </view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goods:[],
				phone:""
			};
		},
		onShow() {
			
			this.phone = uni.getStorageSync('phone')
			this.getcate()
		},
		
		methods:{
			getcate:function(){
				console.log(this.phone)
				if(this.phone == "" || this.phone == undefined){
					this.goods = []
					uni.showModal({
					    content: '请登录后报名',
						// showCancel:false,
						// cancel:false,
						confirmText:'确定',
					    success: function (res) {
					        if (res.confirm) {
					            uni.navigateTo({
					              url: '../login/login'
					            })
					        }
					    }
					});
				}else{
					uni.request({
					    url: this.$url + "inf/user/getMyMessageList",
						data:{
							phone:this.phone
						},
					    success: (res) => {
					        if(res.data.code == 200){
								this.goods = res.data.data
							}
					    }
					});
				}
				
			},
			
		},
		
		
    onPullDownRefresh() {
      uni.stopPullDownRefresh()
    }
	}
</script>

<style lang="scss">
  .page {padding-top: var(--status-bar-height);}
  .icon {
    width: 69upx;
    height: 69upx;
    border-radius: 100px;
    margin-right: 10px;
  }
  .mes {
    display: flex;
    align-items: center;
    font-size: 16px;
    border-bottom: 1px solid #f1f1f1;
    padding-bottom: 10px;
    margin-bottom: 10px;
	margin-top:10px;
    .mes-title {width: 560upx}
  }
</style>
